const path=require('path');
const webpack=require('webpack');
const VueLoaderPlugin = require('vue-loader/lib/plugin');


module.exports={
	entry:{
		register:path.join(__dirname,'web/src/js/register.js'),
		login:path.join(__dirname,'web/src/js/login.js'),
		reset_password:path.join(__dirname,'web/src/js/reset_password.js'),
		me:path.join(__dirname,'web/src/js/me.js'),
		setting:path.join(__dirname,'web/src/js/setting.js'),
		modify_password:path.join(__dirname,'web/src/js/modify_password.js'),
		QR_code:path.join(__dirname,'web/src/js/QR_code.js'),
		modify_phone:path.join(__dirname,'web/src/js/modify_phone.js'),
		feedback:path.join(__dirname,'web/src/js/feedback.js'),
		person_info:path.join(__dirname,'web/src/js/person_info.js'),
		msg:['babel-polyfill',path.join(__dirname,'web/src/chat/main.js')]
		//chat:path.join(__dirname,'web/src/chat/main.js')
	},
	output:{
		path:path.join(__dirname,'web/dist'),
		filename:'js/[name].js',
		publicPath:''
	},
	module:{
		rules:[
			{
				test:/\.js$/,
				exclude:/node_modules/,
				loader:'babel-loader'
			}, {
				test: /\.vue$/,
				loader: 'vue-loader',
				options: {
					loaders: {}
					// other vue-loader options go here
				}
			}, {
				test: /\.css$/,
				use: [
				  'vue-style-loader',
				  'css-loader',
				  'less-loader'
				],
			}, {
				test:/\.(jpeg|jpg|gif|png|svg)$/,
				loader:'file-loader?name=images/[name].[ext]'
			}
		]
	},
	resolve: {
		alias: {
		  
		},
		extensions: ['*', '.js', '.vue', '.json']
	},
	plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
	devServer:{
		contentBase:__dirname+'web/dist'
	},
	watch:true,

}